package day1204zy;

import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) throws Exception {
        System.out.println("请输入第一个数字：");
        int j = 0;
        try {
            j = new Scanner(System.in).nextInt();
        } catch (Exception e) {
            throw new Exception("输入类型错误");
        }
        System.out.println("请输入第二个数字：");
        int i = 0;
        try {
            i = new Scanner(System.in).nextInt();
        } catch (Exception e) {
            throw new Exception("输入类型错误");
        }
        System.out.println("两数之和为：");
        System.out.println(i+j);
    }
}
